package Multithreading.Exercise007;

/**
 * ClassName:ThreadDome
 * Package:Multithreading.Exercise007
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/3/6-23:37
 * @Version:v1.0
 */
public class ThreadDome {
    /*强红包也用到了多线程
    * 假设：100块,分成3个包,现在有5个人去抢
    * 其中,红包是共享数据
    * 5个人是5条线程
    * 打印结果如下：
    *      xxx抢到了xxx元
    *      xxx抢到了xxx元
    *      xxx抢到了xxx元
    *      xxx没抢到
    *      xxx没抢到*/
    public static void main(String[] args) {
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        MyThread t3 = new MyThread();
        MyThread t4 = new MyThread();
        MyThread t5 = new MyThread();


        t1.setName("小明");
        t2.setName("杰哥");
        t3.setName("永哥");
        t4.setName("泉哥");
        t5.setName("玉总");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
    }
}
